package com.atguigu.stack;

import java.util.Stack;

/**
 * @author 龍
 */
public class StackDemo {
    public static void main(String[] args) {
        Stack<String> stack = new Stack<String>();
        //入栈的操作
        stack.add("张三");
        stack.add("李四");
        stack.add("王五");
        //取出顺序：王五，李四，张三
        while (stack.size()>0){
            System.out.println(stack.pop());
        }

    }
}
